﻿using System;
using System.Collections.Generic;
using System.Windows.Forms;
using log4net;

namespace DSCUpdate
{
    static class Program
    {
        private static readonly ILog _logger = LogManager.GetLogger(typeof(Program).Name);

        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            //System.Diagnostics.Process.Start("DSC.exe");
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            //Application.Run(new frmUpdate());
            try
            {
                AfitFile.CopyDirectory(Application.StartupPath + "/pts", Application.StartupPath, true);
                AfitFile.DeleteFolder(Application.StartupPath + "/pts");
                AfitFile.DeleteFile(Application.StartupPath + "/pts.zip");
                AfitFile.DeleteFile(Application.StartupPath + "/pts.zip.tmp");
                System.Diagnostics.Process.Start("DSC.exe");
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                _logger.Error(ex.Message);
            }
        }
    }
}
